Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide: remove multiArch=false and wrong usage of extraPkgs #279260

Merged
merged 3 commits into from
May 14, 2024

Conversation

SuperSamus
Copy link
Contributor

Description of changes

Cleanup after the work of #240860.
Motivation: prevent new packages to copy from outdated examples.
Didn't test.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 11-100 labels Jan 7, 2024
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/3593

@SuperSandro2000
Copy link
Member

fyi @Atemu

@Atemu
Copy link
Member

Atemu commented Mar 8, 2024

This appears to change eval on many of the touched packages, what's the difference?

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Mar 8, 2024
@SuperSamus
Copy link
Contributor Author

This appears to change eval on many of the touched packages, what's the difference?

Sorry for the late response, but I don't know.

@Atemu
Copy link
Member

Atemu commented Apr 23, 2024

Please investigate that, I do not feel comfortable merging this otherwise.

@SuperSamus
Copy link
Contributor Author

Alright, I found the cause.
Before, some packages were listed twice:

  • In multiPkgs (because they were there by default)
  • In extraPkgs (because of extraPkgs = pkgs: (appimageTools.defaultFhsEnvArgs.multiPkgs pkgs))

By removing the latter, these packages are listed only once.

Example with Zettlr (I took the pkgs from the derivations and prettified the JSON).

By using a text comparison tool (or a duplicate counter), you can see that "After PR" only removes duplicates.

I only tested Zettlr, but I suppose it's the same for the others.

@Atemu Atemu requested a review from pbsds April 24, 2024 12:41
@Atemu
Copy link
Member

Atemu commented Apr 24, 2024

Could you squash this into one commit? It's a tree-wide change, so that's one logical step.

@pbsds
Copy link
Member

pbsds commented Apr 24, 2024

Result of nixpkgs-review pr 279260 run on x86_64-linux 1

13 packages built:
  • Sylk
  • bloomrpc
  • chrysalis
  • flexoptix-app
  • joplin-desktop
  • marktext
  • mycrypto
  • notable
  • plexamp
  • polypane
  • station
  • tusk
  • zettlr

@Atemu
Copy link
Member

Atemu commented Apr 24, 2024

There's a conflict now. Could you also add a commit message that explains the background of the change? The contributor's manual has a section on that. It should also say something to the effect of treewide: remove multiArch=false from buildFHSEnv usages.

Other than that, this LGTM.

@SuperSamus
Copy link
Contributor Author

SuperSamus commented Apr 24, 2024

So, I just noticed that there are other packages that do extraPkgs = pkgs: appimageTools.defaultFhsEnvArgs.multiPkgs pkgs;, which I didn't notice before because they didn't set multiArch = false; (the only thing I searched for).
I guess I should make a separate commit for that. Or an entirely different PR.

What do you say?

@SuperSamus
Copy link
Contributor Author

SuperSamus commented Apr 24, 2024

35 packages that either do extraPkgs = pkgs: appimageTools.defaultFhsEnvArgs.multiPkgs pkgs; or accidentally use the top-level input.
With the latter I mean:

{ appimageTools, pandoc }:
appimageTools.wrapType2 {
  # Haa, the joys of being bamboozled by the `with;` keyword!
  # I can say that I've had experience with that, I'm definitively not still angry about the time I wasted for #248898.
  extraPkgs = pkgs: with pkgs; [ pandoc ];
}

Maybe fixing this should be a separate PR.

@Atemu
Copy link
Member

Atemu commented Apr 24, 2024

I guess I should make a separate commit for that. Or an entirely different PR.

Certainly a separate commit.

It fits the theme of outdated pattern/convention cleanup surrounding buildFHSEnv of this PR and is related, so I wouldn't mind having it in here.

accidentally use the top-level input.

Oh man, time for NixOS/rfcs#110...

@SuperSamus SuperSamus changed the title treewide: remove multiArch=false treewide: remove multiArch=false and wrong usage of extraPkgs Apr 24, 2024
@SuperSamus SuperSamus force-pushed the multiPkgs-false-remove branch 3 times, most recently from 11565d5 to 9f2f6a6 Compare April 24, 2024 22:47
@SuperSamus
Copy link
Contributor Author

So, there are 5 packages that use wrapAppImage instead of wrapType2.
Documentation doesn't mention the existence of the former at all.
Also, while in wrapType2 extraPkgs defaults to [ ], the same doesn't apply to wrapAppImage (which has no default).
It seems to me that wrapAppImage is only meant to be called by wrapType2 and nothing else.

Should I convert all the usages of wrapAppImage to wrapType2?
Or just put extraPkgs ? pkgs: [ ] in wrapAppImage?

@SuperSamus
Copy link
Contributor Author

I'm waiting for comments before proceeding further.

@pbsds
Copy link
Member

pbsds commented Apr 30, 2024

extraPkgs ? pkgs: [ ] strikes me as a sane default

Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're looking at remnants of previous iterations of this interface where there was support for multiple versions of the appimage format. These days, everything just uses wrapType2 IIRC.

Appimage support in general needs some cleanup.

This LGTM.

@wegank wegank added 12.approvals: 2 This PR was reviewed and approved by two reputable people and removed 12.approvals: 1 This PR was reviewed and approved by one reputable person labels May 9, 2024
Cleanup after the work of NixOS#240860.
Also preventing new packages to copy from outdated ones.
Sane default in preparation for the next commit.
Mostly removes unnecessary use of `extraPkgs = pkgs: appimageTools.defaultFhsEnvArgs.multiPkgs pkgs;`
This caused some packages to be listed twice.

Also, fix some styling, and accidental use of top-level packages (sometimes due to the `with;` keyword, e.g. on `beeper`).
Remove inclusions of `bash`, since `bashInteractive` is already present by default.
@Atemu Atemu merged commit b4047a0 into NixOS:master May 14, 2024
20 checks passed
@Atemu
Copy link
Member

Atemu commented May 14, 2024

Thank you!

@SuperSamus SuperSamus deleted the multiPkgs-false-remove branch July 22, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 11-100 12.approvals: 2 This PR was reviewed and approved by two reputable people
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants